<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Bomberman:  Fichier source de /home/ph3w/Bureau/lif7-bomberman/metaProg.inl</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.7.1 -->
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
<div class="header">
  <div class="headertitle">
<h1>/home/ph3w/Bureau/lif7-bomberman/metaProg.inl</h1>  </div>
</div>
<div class="contents">
<a href="meta_prog_8inl.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************/</span><span class="comment">/*!</span>
<a name="l00002"></a>00002 <span class="comment">* @brief Fonction de calcule Factorielle.</span>
<a name="l00003"></a>00003 <span class="comment">* @param[in] N Le nombre a calculer</span>
<a name="l00004"></a>00004 <span class="comment">*</span>
<a name="l00005"></a>00005 <span class="comment">* Utilisation:</span>
<a name="l00006"></a>00006 <span class="comment">* @code</span>
<a name="l00007"></a>00007 <span class="comment">* printf(&quot;Factoriel de 5 %d&quot;, Fact&lt;5&gt;::value);</span>
<a name="l00008"></a>00008 <span class="comment">* @endcode</span>
<a name="l00009"></a>00009 <span class="comment">* @note Calculs effectués à la compilation</span>
<a name="l00010"></a>00010 <span class="comment">* @warning NE PAS METTRE DE VALEUR INCONNUE !</span>
<a name="l00011"></a>00011 <span class="comment">*/</span>
<a name="l00012"></a><a class="code" href="struct_fact.html">00012</a> <span class="keyword">template</span> &lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> N&gt; <span class="keyword">struct </span><a class="code" href="struct_fact.html" title="Fonction de calcule Factorielle.">Fact</a>
<a name="l00013"></a>00013 {
<a name="l00014"></a><a class="code" href="struct_fact.html#a8d937d0b8aedcd84a89d1655873ea4daa52b4e761efeb9c8be58e7022551c68a2">00014</a>     <span class="keyword">enum</span> { <a class="code" href="struct_fact.html#a8d937d0b8aedcd84a89d1655873ea4daa52b4e761efeb9c8be58e7022551c68a2">value</a> = N * <a class="code" href="struct_fact.html" title="Fonction de calcule Factorielle.">Fact</a>&lt;N-1&gt;<a class="code" href="struct_fact.html#a8d937d0b8aedcd84a89d1655873ea4daa52b4e761efeb9c8be58e7022551c68a2">::value</a> };
<a name="l00015"></a>00015 };
<a name="l00016"></a><a class="code" href="struct_fact_3_010_01_4.html">00016</a> <span class="keyword">template</span> &lt;&gt; <span class="keyword">struct </span><a class="code" href="struct_fact.html" title="Fonction de calcule Factorielle.">Fact</a>&lt;0&gt;
<a name="l00017"></a>00017 {
<a name="l00018"></a><a class="code" href="struct_fact_3_010_01_4.html#a1f74bd65beaa6a993eab0d3332235c39a3efcc7250b77c53ab8d35b892253c8cc">00018</a>     <span class="keyword">enum</span> { <a class="code" href="struct_fact.html#a8d937d0b8aedcd84a89d1655873ea4daa52b4e761efeb9c8be58e7022551c68a2">value</a> = 1 };
<a name="l00019"></a>00019 };
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="comment">/***************************************************************************/</span><span class="comment">/*!</span>
<a name="l00023"></a>00023 <span class="comment">* @brief Fonction de calcule un nombre (N) à Puissance (puiss).</span>
<a name="l00024"></a>00024 <span class="comment">* @param[in] N Le nombre a calculer</span>
<a name="l00025"></a>00025 <span class="comment">* @param[in] puiss La puissance</span>
<a name="l00026"></a>00026 <span class="comment">*</span>
<a name="l00027"></a>00027 <span class="comment">* Utilisation:</span>
<a name="l00028"></a>00028 <span class="comment">* @code</span>
<a name="l00029"></a>00029 <span class="comment">* printf(&quot;5 au carré = %d&quot;, Pow&lt;5,2&gt;::value);</span>
<a name="l00030"></a>00030 <span class="comment">* @endcode</span>
<a name="l00031"></a>00031 <span class="comment">* @note Calculs effectués à la compilation</span>
<a name="l00032"></a>00032 <span class="comment">* @warning NE PAS METTRE DE VALEUR INCONNUE !</span>
<a name="l00033"></a>00033 <span class="comment">*/</span>
<a name="l00034"></a><a class="code" href="struct_pow.html">00034</a> <span class="keyword">template</span> &lt; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> N, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> puiss &gt; <span class="keyword">struct </span><a class="code" href="struct_pow.html" title="Fonction de calcule un nombre (N) à Puissance (puiss).">Pow</a>
<a name="l00035"></a>00035 {
<a name="l00036"></a><a class="code" href="struct_pow.html#a1897935ea313434a89bf433ec34ac068a2c3bfb1ec024914f5e61c8c340ae1cc8">00036</a>     <span class="keyword">enum</span> { <a class="code" href="struct_pow.html#a1897935ea313434a89bf433ec34ac068a2c3bfb1ec024914f5e61c8c340ae1cc8">value</a> = N * <a class="code" href="struct_pow.html" title="Fonction de calcule un nombre (N) à Puissance (puiss).">Pow</a>&lt;N, puiss-1&gt;<a class="code" href="struct_pow.html#a1897935ea313434a89bf433ec34ac068a2c3bfb1ec024914f5e61c8c340ae1cc8">::value</a> };
<a name="l00037"></a>00037 };
<a name="l00038"></a><a class="code" href="struct_pow_3_01_n_00_010_01_4.html">00038</a> <span class="keyword">template</span> &lt; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> N &gt; <span class="keyword">struct </span><a class="code" href="struct_pow.html" title="Fonction de calcule un nombre (N) à Puissance (puiss).">Pow</a>&lt;N, 0&gt;
<a name="l00039"></a>00039 {
<a name="l00040"></a><a class="code" href="struct_pow_3_01_n_00_010_01_4.html#afc563d80ab9c7e328d1140da87e0a4b7a214e774073b0eefe9b45fc8061551283">00040</a>     <span class="keyword">enum</span> { <a class="code" href="struct_pow.html#a1897935ea313434a89bf433ec34ac068a2c3bfb1ec024914f5e61c8c340ae1cc8">value</a> = 1 };
<a name="l00041"></a>00041 };
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="comment">/***************************************************************************/</span><span class="comment">/*!</span>
<a name="l00045"></a>00045 <span class="comment">* @brief Détermine le nombre de chiffre dans un nombre. (NOMBRE POSITIF !)</span>
<a name="l00046"></a>00046 <span class="comment">* @param[in] N Le nombre a calculer</span>
<a name="l00047"></a>00047 <span class="comment">*</span>
<a name="l00048"></a>00048 <span class="comment">* Utilisation:</span>
<a name="l00049"></a>00049 <span class="comment">* @code</span>
<a name="l00050"></a>00050 <span class="comment">* printf(&quot;Il y a %d chiffre dans le nombre 5380&quot;, getSizeOfNumber&lt;5380&gt;::value);</span>
<a name="l00051"></a>00051 <span class="comment">* @endcode</span>
<a name="l00052"></a>00052 <span class="comment">* @note Calculs effectués à la compilation</span>
<a name="l00053"></a>00053 <span class="comment">* @warning NE PAS METTRE DE VALEUR INCONNUE !</span>
<a name="l00054"></a>00054 <span class="comment">* @see struct getSizeOfNumberS</span>
<a name="l00055"></a>00055 <span class="comment">*/</span>
<a name="l00056"></a><a class="code" href="structget_size_of_number.html">00056</a> <span class="keyword">template</span> &lt; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> N &gt; <span class="keyword">struct </span><a class="code" href="structget_size_of_number.html" title="Détermine le nombre de chiffre dans un nombre. (NOMBRE POSITIF !).">getSizeOfNumber</a>
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058     <span class="keyword">enum</span> {
<a name="l00059"></a><a class="code" href="structget_size_of_number.html#aaeef8257b65933e34908c9ac75d1e41ca9623f6ed283d05a13844b76982e92b6d">00059</a>         <a class="code" href="structget_size_of_number.html#aaeef8257b65933e34908c9ac75d1e41ca9623f6ed283d05a13844b76982e92b6d">value</a> = 1+ <a class="code" href="structget_size_of_number.html" title="Détermine le nombre de chiffre dans un nombre. (NOMBRE POSITIF !).">getSizeOfNumber</a>&lt; N/10 &gt;<a class="code" href="structget_size_of_number.html#aaeef8257b65933e34908c9ac75d1e41ca9623f6ed283d05a13844b76982e92b6d">::value</a>
<a name="l00060"></a>00060     };
<a name="l00061"></a>00061 };
<a name="l00062"></a><a class="code" href="structget_size_of_number_3_010_01_4.html">00062</a> <span class="keyword">template</span> &lt;&gt; <span class="keyword">struct </span><a class="code" href="structget_size_of_number.html" title="Détermine le nombre de chiffre dans un nombre. (NOMBRE POSITIF !).">getSizeOfNumber</a>&lt;0&gt;
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064     <span class="keyword">enum</span> {
<a name="l00065"></a><a class="code" href="structget_size_of_number_3_010_01_4.html#a7886d0f67d87fab5159de4411e43b7e4adffdfb9ad2f03f900c2202d2460a45c9">00065</a>         <a class="code" href="structget_size_of_number.html#aaeef8257b65933e34908c9ac75d1e41ca9623f6ed283d05a13844b76982e92b6d">value</a> = 0
<a name="l00066"></a>00066     };
<a name="l00067"></a>00067 };
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="comment">/***************************************************************************/</span><span class="comment">/*!</span>
<a name="l00071"></a>00071 <span class="comment">* @brief Ensemble de test</span>
<a name="l00072"></a>00072 <span class="comment">* @param[in] N Le nombre a tester</span>
<a name="l00073"></a>00073 <span class="comment">*</span>
<a name="l00074"></a>00074 <span class="comment">* Utilisation:</span>
<a name="l00075"></a>00075 <span class="comment">* @code</span>
<a name="l00076"></a>00076 <span class="comment">* printf(&quot;5380 est paire? : %d\n 5380 est négatif? : %d&quot;, test&lt;5380&gt;::isPair, test&lt;5380&gt;::isNegative);</span>
<a name="l00077"></a>00077 <span class="comment">* @endcode</span>
<a name="l00078"></a>00078 <span class="comment">* @note Calculs effectués à la compilation</span>
<a name="l00079"></a>00079 <span class="comment">* @warning NE PAS METTRE DE VALEUR INCONNUE !</span>
<a name="l00080"></a>00080 <span class="comment">*/</span>
<a name="l00081"></a><a class="code" href="structtest.html">00081</a> <span class="keyword">template</span> &lt; <span class="keywordtype">int</span> N &gt; <span class="keyword">struct </span><a class="code" href="structtest.html" title="Ensemble de test.">test</a>
<a name="l00082"></a>00082 {
<a name="l00083"></a>00083     <span class="keyword">enum</span> {
<a name="l00084"></a><a class="code" href="structtest.html#aabe2e5fb317bc007d6e047fcf1e174f8a27be53f545052817fd01a9d772db9bda">00084</a>         <a class="code" href="structtest.html#aabe2e5fb317bc007d6e047fcf1e174f8a27be53f545052817fd01a9d772db9bda">isPair</a> = ( N%2 ? <span class="keyword">false</span> : true ),
<a name="l00085"></a><a class="code" href="structtest.html#aabe2e5fb317bc007d6e047fcf1e174f8a4f61833e1350676e888fe6088f92897b">00085</a>         <a class="code" href="structtest.html#aabe2e5fb317bc007d6e047fcf1e174f8a4f61833e1350676e888fe6088f92897b">isNegative</a> = ( N&lt;0 ? <span class="keyword">true</span> : <span class="keyword">false</span> )
<a name="l00086"></a>00086     };
<a name="l00087"></a>00087 };
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 <span class="comment">/***************************************************************************/</span><span class="comment">/*!</span>
<a name="l00091"></a>00091 <span class="comment">* @brief Détermine le nombre de chiffre dans un nombre. (Positif ou négatif). Prise en compte du signe - dans les calculs.</span>
<a name="l00092"></a>00092 <span class="comment">* @param[in] N Le nombre a calculer</span>
<a name="l00093"></a>00093 <span class="comment">*</span>
<a name="l00094"></a>00094 <span class="comment">* Utilisation:</span>
<a name="l00095"></a>00095 <span class="comment">* @code</span>
<a name="l00096"></a>00096 <span class="comment">* printf(&quot;Il y a %d chiffre dans le nombre -12&quot;, getSizeOfNumberS&lt;-12&gt;::value);</span>
<a name="l00097"></a>00097 <span class="comment">* @endcode</span>
<a name="l00098"></a>00098 <span class="comment">* @note Calculs effectués à la compilation</span>
<a name="l00099"></a>00099 <span class="comment">* @warning NE PAS METTRE DE VALEUR INCONNUE !</span>
<a name="l00100"></a>00100 <span class="comment">*/</span>
<a name="l00101"></a><a class="code" href="struct__get_size_of_number_s.html">00101</a> <span class="keyword">template</span> &lt; <span class="keywordtype">int</span> N &gt; <span class="keyword">struct </span><a class="code" href="struct__get_size_of_number_s.html" title="Détermine le nombre de chiffre dans un nombre. (Positif ou négatif). Prise en compte du signe - dans ...">_getSizeOfNumberS</a><span class="comment">// Sous fonction. NE pas utiliser directement</span>
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103     <span class="keyword">enum</span> {
<a name="l00104"></a><a class="code" href="struct__get_size_of_number_s.html#a64e36aa90ba798fe107ff67ebdbfd6f4afd548a54444b56b1508d1e2bec0e8924">00104</a>         <a class="code" href="struct__get_size_of_number_s.html#a64e36aa90ba798fe107ff67ebdbfd6f4afd548a54444b56b1508d1e2bec0e8924">value</a> = 1 + <a class="code" href="struct__get_size_of_number_s.html" title="Détermine le nombre de chiffre dans un nombre. (Positif ou négatif). Prise en compte du signe - dans ...">_getSizeOfNumberS</a>&lt; N/10 &gt;<a class="code" href="struct__get_size_of_number_s.html#a64e36aa90ba798fe107ff67ebdbfd6f4afd548a54444b56b1508d1e2bec0e8924">::value</a>
<a name="l00105"></a>00105     };
<a name="l00106"></a>00106 };
<a name="l00107"></a><a class="code" href="struct__get_size_of_number_s_3_010_01_4.html">00107</a> <span class="keyword">template</span> &lt;&gt; <span class="keyword">struct </span><a class="code" href="struct__get_size_of_number_s.html" title="Détermine le nombre de chiffre dans un nombre. (Positif ou négatif). Prise en compte du signe - dans ...">_getSizeOfNumberS</a>&lt;0&gt;<span class="comment">// Sous fonction. NE pas utiliser directement</span>
<a name="l00108"></a>00108 {
<a name="l00109"></a>00109     <span class="keyword">enum</span> {
<a name="l00110"></a><a class="code" href="struct__get_size_of_number_s_3_010_01_4.html#a698c31bb93ad99635e286462b41ae41aa59791b8bb624e380f186a67b5630ea09">00110</a>         <a class="code" href="struct__get_size_of_number_s.html#a64e36aa90ba798fe107ff67ebdbfd6f4afd548a54444b56b1508d1e2bec0e8924">value</a> = 0
<a name="l00111"></a>00111     };
<a name="l00112"></a>00112 };
<a name="l00113"></a><a class="code" href="structget_size_of_number_s.html">00113</a> <span class="keyword">template</span> &lt; <span class="keywordtype">int</span> N &gt; <span class="keyword">struct </span><a class="code" href="structget_size_of_number_s.html">getSizeOfNumberS</a>
<a name="l00114"></a>00114 {
<a name="l00115"></a>00115     <span class="keyword">enum</span> {
<a name="l00116"></a><a class="code" href="structget_size_of_number_s.html#a8758cfe783f79f9d9a0066ec730aecf8a7a5b8866f7be5907b1051d368db70346">00116</a>         <a class="code" href="structget_size_of_number_s.html#a8758cfe783f79f9d9a0066ec730aecf8a7a5b8866f7be5907b1051d368db70346">value</a> = <a class="code" href="struct__get_size_of_number_s.html" title="Détermine le nombre de chiffre dans un nombre. (Positif ou négatif). Prise en compte du signe - dans ...">_getSizeOfNumberS&lt;N&gt;::value</a> + (<a class="code" href="structtest.html" title="Ensemble de test.">test&lt;N&gt;::isNegative</a> ? 1 : 0 )
<a name="l00117"></a>00117     };
<a name="l00118"></a>00118 };
<a name="l00119"></a>00119 
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 <span class="comment">/***************************************************************************/</span><span class="comment">/*!</span>
<a name="l00122"></a>00122 <span class="comment">* @brief Liste de valeurs intéressantes</span>
<a name="l00123"></a>00123 <span class="comment">*</span>
<a name="l00124"></a>00124 <span class="comment">* @note Calculs effectués à la compilation</span>
<a name="l00125"></a>00125 <span class="comment">*/</span>
<a name="l00126"></a>00126 <span class="keyword">enum</span> {
<a name="l00127"></a><a class="code" href="meta_prog_8inl.html#a99fb83031ce9923c84392b4e92f956b5aa6ab291ddde20dbab3a32cffd81fc8fb">00127</a>     <a class="code" href="meta_prog_8inl.html#a99fb83031ce9923c84392b4e92f956b5aa6ab291ddde20dbab3a32cffd81fc8fb">Is32Bits</a> = (<span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*) == 4 ? 1 : 0),
<a name="l00128"></a><a class="code" href="meta_prog_8inl.html#a99fb83031ce9923c84392b4e92f956b5af906545fd55cc125a7411ca8a0a2d5dd">00128</a>     <a class="code" href="meta_prog_8inl.html#a99fb83031ce9923c84392b4e92f956b5af906545fd55cc125a7411ca8a0a2d5dd">Is64Bits</a> = (<span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*) == 8 ? 1 : 0)
<a name="l00129"></a>00129 };
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Généré le Fri Jan 21 2011 01:21:27 pour Bomberman par&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
